package lihua.robot.controller;


import lihua.robot.common.Result;
import lihua.robot.pojo.Device;
import lihua.robot.service.DeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping(value="/robot_device_state")
public class DeviceController {

    @Autowired
    public DeviceService deviceService;

    /**
     * 初始化设备桶的状态
     * @param device
     * @return
     */
    @PostMapping("updateState")
    public Result updateState(@RequestBody Device device){
        deviceService.getBaseMapper().updateById(device);
        return Result.success("修改成功");
    }

}
